import request from '../utils/request.js';

//查询所有部门
export const queryAllApi = ()=>{
 return request.get('/depts')
}

// //新增部门
// export const saveApi = (dept)=>{
//  return request.post('/depts',dept)
// }

//添加部门
export const saveApi = (data) => request.post('/depts', data);

//根据id查询部门
export const findByIdApi = (id)=> request.get(`/depts/${id}`);

// export const findByIdApi2 = (id)=> request.get('/depts/'+id)

//根据id修改部门
export const updateApi = (dept) => request.put('/depts',dept);

//根据id删除部门
export const deleteApi = (id) => request.delete(`/depts?id=${id}`);

